﻿<%@ Page Title="" Language="C#" MasterPageFile="~/TemplateUser.Master" AutoEventWireup="true" CodeBehind="order.aspx.cs" Inherits="ProjectSem3.WebForm6" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script language="javascript" type="text/javascript">
    $(document).ready(function () {

        $('.datestart').datepicker();
        $('.dateend').datepicker();

        $(".DropdownName").change(function (e) {
            var name = $('#<%=DropDownListPolicy.ClientID %> option:selected').text();
            $.ajax({
                type: "POST",
                url: "order.aspx/Hello",
                data: "{'name':'" + name + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg) {
                    var abc = msg.d;
                    var content = abc.split('|');
                    $(".TextBoxAmountc").val(content[0]);
                    $(".TextBoxEMI").val(content[1]);
                    $(".TextBoxHospitalname").val(content[2]);
                }
            });
        });
        $('#form1').validate({
            rules: {
                <%=TextBoxAmount.UniqueID %>: {
                    required: true
                },
                <%=TextBoxEMI.UniqueID %>: {
                    required: true
                },
                <%=TextBoxHospitalname.UniqueID %>: {
                    required: true
                },
                <%=datestart.UniqueID %>: {
                    required: true
                },
                <%=dateend.UniqueID %>: {
                    required: true
                },
            }
        });

    });
</script>
<style type="text/css">
    label.error
    {
        color:Red;
        }
</style>
<div style="width:665px; height:500px;">
    <div style="width:445px; height:370px; background-color: #CCCCCC; margin:25px 0 0 120px; border-radius:15px;">
    <ul style="list-style-type: none; margin-left:0px;">
        <li>
            <h3><asp:Label ID="Label2" runat="server" Text="Buy Insurance Policy" style="color:Blue; margin-left:80px;"></asp:Label></h3>
        </li>
        <li ID="Baokq" runat="server">
            <asp:Label ID="LabelKQ" runat="server"  Text="Send successful" style="color:Red; margin-left:80px;"></asp:Label>
        </li>
    </ul>
    <ul ID="ulkq" runat="server" style="list-style-type:none; margin-left:0px;">
    <li style="margin-bottom:15px;">
        <asp:Label ID="Label1" runat="server" Text="Username :"></asp:Label>
        <div style="margin: -25px 0 0 110px; width:165px; height:25px;">
            <asp:TextBox ID="TextBox1" runat="server" style="width:165px; height:20px;" 
                ReadOnly="True"></asp:TextBox>
        </div>
    </li>
    <li style="margin-bottom:15px;">
        <asp:Label ID="Label3" runat="server" Text="Policy Name :"></asp:Label>
        <div style="margin:-25px 0 0 110px;">
            <asp:DropDownList ID="DropDownListPolicy" runat="server" class="DropdownName"
                style="width:165px; height:20px;" EnableTheming="True" TabIndex="1">
            </asp:DropDownList>
        </div>
    </li>
    <li>
        <asp:Label ID="Label7" runat="server" Text="Amount"></asp:Label>
        <div style="margin: -25px 0 0 110px; width:165px; height:25px;">
            <asp:TextBox ID="TextBoxAmount" runat="server" style="width:165px; height:20px;" 
                ReadOnly="True" class="TextBoxAmountc"></asp:TextBox>
        </div>
    </li>
    <li>
        <asp:Label ID="Label8" runat="server" Text="EMI"></asp:Label>
        <div style="margin: -25px 0 0 110px; width:165px; height:25px;">
            <asp:TextBox ID="TextBoxEMI" runat="server" style="width:165px; height:20px;" 
                ReadOnly="True" class="TextBoxEMI"></asp:TextBox>
        </div>
    </li>
    <li>
        <asp:Label ID="Label9" runat="server" Text="Hospital Name"></asp:Label>
        <div style="margin: -25px 0 0 110px; width:165px; height:25px;">
            <asp:TextBox ID="TextBoxHospitalname" runat="server" style="width:165px; height:20px;" 
                ReadOnly="True" class="TextBoxHospitalname"></asp:TextBox>
        </div>
    </li>
    <li>
        <asp:Label ID="Label4" runat="server" Text="Company Name :"></asp:Label>
        <div style="margin:-25px 0 0 110px;">
            <asp:DropDownList ID="DropDownListCompany" runat="server" 
                style="width:165px; height:20px;" TabIndex="2">
            </asp:DropDownList>
        </div>
    </li>
    <li>
        <asp:Label ID="Label5" runat="server" Text="Policy Start Date :"></asp:Label>
        <div style="margin:-25px 0 0 110px;">
            <input runat="server" type="text" class="datestart" name="date" value="" 
                id="datestart" tabindex="3"/>
        </div>
    </li>
    <li>
        <asp:Label ID="Label6" runat="server" Text="Policy End Date :"></asp:Label>
        <div style="margin:-25px 0 0 110px;">
            <input runat="server" type="text" class="dateend" name="date" value="" 
                id="dateend" tabindex="4"/>
        </div>
    </li>
    <li>
        <asp:Button ID="ButtonBuy" runat="server" Text="Buy" 
            style="margin:25px 0 0 100px;" onclick="ButtonBuy_Click" />
    </li>
    </ul>
    </div>
</div>
</asp:Content>
